package com.xq.shop.vo;

import org.apache.commons.lang.StringUtils;


public class SearchValue {

	public enum Pattern {
		IN, LIKE, EQUAL, NOTEQUAL
	}
	
	public enum Order {
		ASC, DESC
	}
	
	private String name;	//查询列名
	private Object value;	//查询列值
	private Order order;	//是否按列排序
	private Pattern pattern;	//条件方式
	private int orderSeq;		//按钮排序的顺序
	
	public SearchValue() { }
	
	public SearchValue(String name, Object value, Pattern pattern){
		this.name = name;
		this.value = value;
		this.pattern = pattern;
	}
	
	public boolean isBlank(){
		
		if(StringUtils.isBlank(name) || value == null || StringUtils.isBlank(value.toString())){	//如果查询列不为空，可能是排序，可能是查询值
			return true;
		}
		return false;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	public int getOrderSeq() {
		return orderSeq;
	}

	public void setOrderSeq(int seq) {
		this.orderSeq = seq;
	}

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public Pattern getPattern() {
		return pattern;
	}

	public void setPattern(Pattern pattern) {
		this.pattern = pattern;
	}
}
